<?php
session_start();
 if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
?>
     

<html>
<head>
<title>Administrator Widoro</title>
<link rel="shortcut icon" href="smk.png" />
<link rel="stylesheet" type="text/css" href="css/expose-form.css">
    <script type="text/javascript" src="js/jquery.tools.min.js"></script>

    <script type="text/javascript"> 
      $(document).ready(function(){
      	// expose form ketika form di klik atau kursor mouse berada di salah satu komponen form
	      $("form.expose").bind("click keydown", function() {
          $(this).expose({

			     // setting mask/penutup untuk background dengan CSS
			     maskId: 'mask',

			     // ketika form ter-expose, ganti warna background form
			     onLoad: function() {
				      this.getExposed().css({backgroundColor: '#09F'});
			     },

			     // ketika form tidak ter-expose, kembalikan warna background ke warna semula
			     onClose: function() {
				      this.getExposed().css({backgroundColor: null});
			     },
			     api: true

		      }).load();
	      });
	    });
	  </script>	

<script language="javascript">
function validasi(form){
  if (form.username.value == ""){
    alert("Anda belum mengisikan Username.");
    form.username.focus();
    return (false);
  }
     
  if (form.password.value == ""){
    alert("Anda belum mengisikan Password.");
    form.password.focus();
    return (false);
  }
  return (true);
}
</script>
<body>
<h1 style="color:#FFF; font:Georgia;">Login Administrator Widoro</h1>
<div class="gagal">
<?php
if($_GET['module']=="gagal"){
    echo "Login Gagal Password dan User tidak cocok";
	}
?>
</div>
<form name="login" action="cek_login.php" method="POST" onSubmit="return validasi(this)" class="expose">
<table align="center">
<tr><td>Username</td><td><input type="text" name="username"></td></tr>
<tr><td>Password</td><td><input type="password" name="password"></td></tr>
<tr>
  <td colspan="2" align="center" valign="top"><input type="submit" class="tombol" value="Login"></td></tr>
</table>
</form>


</body>
</html>
<?
}
else{
	header('location:widoropanel.php?module=home');
 } ?>